package org.jsola.hr.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiParam;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;
import org.jsola.core.dto.BaseDTO;
import org.jsola.core.validator.Const;
import org.jsola.hr.constant.CostBillStatus;

import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.List;

import static org.jsola.hr.example.CostBillExample.*;

/**
 * 费用账单
 *
 * @author zhr
 */
@EqualsAndHashCode(callSuper = true)
@ApiModel(description = "新增【费用账单】的参数")
@Data
public class CostBillAddDTO extends BaseDTO {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(notes = N_ANNEX_URL, example = E_ANNEX_URL)
    @Length(max = 2147483647, message = M_ANNEX_URL_MAX)
    private String annexUrl;

    @ApiModelProperty(notes = N_AUTO_SYSTEM, example = E_AUTO_SYSTEM, required = true)
    @NotNull(message = M_AUTO_SYSTEM_NOT_NULL)
    private Boolean autoSystem;

    @ApiModelProperty(notes = N_NUMBER, example = E_NUMBER)
    private Integer number;

    @ApiModelProperty(notes = N_YEAR, example = E_YEAR, required = true)
    @NotNull(message = M_YEAR_NOT_NULL)
    private Integer year;

    @ApiModelProperty(notes = N_MONTH, example = E_MONTH, required = true)
    @NotNull(message = M_MONTH_NOT_NULL)
    private Integer month;

    @ApiModelProperty(notes = N_APPRO_COMPANY_ID, example = E_APPRO_COMPANY_ID)
    @Length(max = 32, message = M_APPRO_COMPANY_ID_MAX)
    private String approCompanyId;

    @ApiModelProperty(notes = N_APPRO_STATUS, example = E_APPRO_STATUS, allowableValues = CostBillStatus.VALUES_STR)
    @Const(constClass = CostBillStatus.class, message = M_APPRO_STATUS_ENUM_NOT_MATCH)
    private Integer approStatus;

    @ApiModelProperty(notes = N_SUBJECT_TYPE, example = E_SUBJECT_TYPE, required = true)
    @NotNull(message = M_SUBJECT_TYPE_NOT_NULL)
    @Length(max = 50, message = M_SUBJECT_TYPE_MAX)
    private String subjectType;

    @ApiModelProperty(notes = N_SUBJECT_ID, example = E_SUBJECT_ID)
    @Length(max = 2147483647, message = M_SUBJECT_ID_MAX)
    private String subjectId;

    @ApiModelProperty(notes = N_BILL_NAME, example = E_BILL_NAME, required = true)
    @Length(max = 50, message = M_BILL_NAME_MAX)
    private String billName;

    @ApiModelProperty(notes = N_COMPANY_ID, example = E_COMPANY_ID)
    @Length(max = 2147483647, message = M_COMPANY_ID_MAX)
    private String companyId;

    @ApiModelProperty(notes = N_COMPANY_NAME, example = E_COMPANY_NAME)
    @Length(max = 100, message = M_COMPANY_NAME_MAX)
    private String companyName;

    @ApiModelProperty(notes = N_PERSONAL_SOC_AMOUNT, example = E_PERSONAL_SOC_AMOUNT)
    private BigDecimal personalSocAmount;

    @ApiModelProperty(notes = N_PERSONAL_PF_AMOUNT, example = E_PERSONAL_PF_AMOUNT)
    private BigDecimal personalPfAmount;

    @ApiModelProperty(notes = N_COMPANY_SOC_AMOUNT, example = E_COMPANY_SOC_AMOUNT)
    private BigDecimal companySocAmount;

    @ApiModelProperty(notes = N_COMPANY_PF_AMOUNT, example = E_COMPANY_PF_AMOUNT)
    private BigDecimal companyPfAmount;

    @ApiModelProperty(notes = N_FINE, example = E_FINE)
    private BigDecimal fine;

    @ApiModelProperty(notes = N_CALCULATE_SALARY_NUMBER, example = E_CALCULATE_SALARY_NUMBER)
    private Integer calculateSalaryNumber;

    @ApiModelProperty(notes = N_PAYROLL_NAME, example = E_PAYROLL_NAME)
    @Length(max = 50, message = M_PAYROLL_NAME_MAX)
    private String payrollName;

    @ApiModelProperty(notes = N_TOTAL_TAX, example = E_TOTAL_TAX)
    private BigDecimal totalTax;

    @ApiModelProperty(notes = N_TOTAL_AMOUNT, example = E_TOTAL_AMOUNT)
    private BigDecimal totalAmount;

    @ApiModelProperty(notes = N_FINAL_AMOUNT, example = E_FINAL_AMOUNT)
    private BigDecimal finalAmount;

    @ApiModelProperty(notes = N_IS_CONFIRM, example = E_IS_CONFIRM)
    private Boolean isConfirm;

    @ApiModelProperty(notes = N_USER_APPRO_ID, example = E_USER_APPRO_ID)
    @Length(max = 50, message = M_USER_APPRO_ID_MAX)
    private String userApproId;


    @ApiParam(value = "公司Id列表")
    private List<String> companyIdList;

    @ApiParam(value = "用工单位组Id")
    private String companyGroupId;

    @ApiModelProperty(notes = N_IS_MERGE, example = E_IS_MERGE)
    private Boolean isMerge;


}

